#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<string>
using namespace std;
namespace zxl
{
	class string
	{
	public:
		string()
		{
			_str = new char[1];
			_str[0] = '\0';
		}
		
		string(const char* str)
			:_str(new char[strlen(str)+1])
		{
			strcpy(_str, str);
		}

		string(const string& s)
		{
			_str = new char[strlen(s._str) + 1];
			strcpy(_str, s._str);
		}
		size_t size()
		{
			return strlen(_str);
		}

		char& operator[](size_t i)
		{
			return _str[i];
		}

		~string()
		{
			delete[]_str;
			_str = nullptr;
		}
	private:
		char* _str;
	};
	
}

int main()
{
	zxl::string s1("hello");
	zxl::string s2;
	zxl::string s3(s1);
	for (size_t i = 0; i < s1.size(); ++i)
	{
		s1[i] += 1;
		cout << s1[i] << " ";
	}
	cout << endl;
	for (size_t i = 0; i < s2.size(); ++i)
	{
		s2[i] += 1;
		cout << s2[i] << " ";
	}
	cout << endl;
	for (size_t i=0; i < s3.size(); i++)
	{
		cout << s3[i] << " ";
	}
	cout << endl;
	return 0;
}